﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DAO
    {
    public class NguyenLieuDAO
        {
        String ConnectionString = "Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=QLTHUCPHAM_FIX;Data Source=(local)";
        public DataTable DSNguyenLieu()
            {
            SqlConnection conn = new SqlConnection(ConnectionString);
            if (conn.State != ConnectionState.Open)
                {
                conn.Open();
                }

            string sql = "SELECT * FROM NguyenLieu";

            SqlDataAdapter adapter = new SqlDataAdapter(sql, conn);
            DataTable datatable = new DataTable("DSSV");
            adapter.Fill(datatable);
            conn.Close();
            return datatable;
            }
        }
    }
